#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <cstdio>
#include <algorithm>

using namespace std;
#define MAX_N 50000

pair<int,int> bit(int n,int a,int b)
{
    int m = -n;
    int n1,n2;
    if(n == 0)
        return make_pair(0,0);
    if(n == 1)
    {

        if(a>=b)
            return make_pair(1,0);
        else
            return make_pair(0,1);
    }
    if(a <= 0)
        return make_pair(0,max(b,n));
    if(b <= 0)
        return make_pair(max(a,n),0);
    for(int i=1;i<=a;i++)
    {
        pair<int,int> tt = bit(n-1,a-i,b);
        if(b<=i)
        {
            if(m<tt.first-tt.second+1)
            {
                n1= tt.first+1;
                n2=tt.second;
                m = n1-n2;
            }
            break;
        }
        pair<int,int> tt1 = bit(n-1,a,b-i-1);
        if(tt.first-tt.second+1 > tt1.first-tt1.second-1){
            if(m<tt1.first-tt1.second-1)
            {
                n1= tt1.first;
                n2=tt1.second+1;
                m = n1-n2;
            }
        }
        else {
            if(m<tt.first-tt.second+1)
            {
                n1= tt.first+1;
                n2=tt.second;
                m = n1-n2;
            }
        }
    }
    return make_pair(n1,n2);
}
int bit2(int n,int a, int b)
{
    pair<int,int> tt = bit(n,a,b);
     //   cout<<endl<<n<<a<<b<<endl;
    if(tt.first < tt.second)
        return -1;
    else if(tt.first == tt.second)
        return 0;
    else
        return 1;
}
int main()
{
    int T;
    int n,a,b;
    cin>>T;
    for (int t = 1; t <= T; t++)
    {
        cin>>n>>a>>b;
        int re = bit2(n,a,b);
        cout<<"Case #"<<t<<": "<<re;
        if(t != T)
            cout<<endl;
    }
    /*
    */
    /*
    cout<< bit2(4,3,5)<<endl;
    cout<< bit2(7,4,7)<<endl;

    */
    return 0;
}


